home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / asm / demos / fuzzyscreen / off_channel_interference.src < prev    next >
Encoding:
Text File  |  1980-01-06  |  3.4 KB  |  166 lines

  1.  
  2. SEED    equ $43f7            ;any old numbers!
  3. CONSTANT1 equ $0001
  4. CONSTANT2 equ $0002
  5. CONSTANT3 equ $0003
  6.  
  7.  
  8.     section maincode,code
  9.  
  10. start    movem.l a0-a6/d1-d7,-(a7)
  11.     move.l #$dff000,a0
  12.     move.l #vars,a1
  13.     move.w $1c(a0),orig_inten(a1)
  14.     move.w $02(a0),orig_dmacon(a1)
  15.  
  16.     move.l #screen,d0        ;top quarter
  17.     move.l #bitplane1,a2
  18.     move.w d0,$6(a2)
  19.     swap d0
  20.     move.w d0,$2(a2)
  21.     swap d0
  22.     addq.l #2,d0
  23.     move.w d0,$e(a2)
  24.     swap d0
  25.     move.w d0,$a(a2)
  26.  
  27.     move.l #screen,d0        ;2nd quarter
  28.     move.l #bitplane2,a2
  29.     move.w d0,$6(a2)
  30.     swap d0
  31.     move.w d0,$2(a2)
  32.     swap d0
  33.     addq.l #2,d0
  34.     move.w d0,$e(a2)
  35.     swap d0
  36.     move.w d0,$a(a2)
  37.  
  38.     move.l #screen,d0        ;3rd quarter
  39.     move.l #bitplane3,a2
  40.     move.w d0,$6(a2)
  41.     swap d0
  42.     move.w d0,$2(a2)
  43.     swap d0
  44.     addq.l #2,d0
  45.     move.w d0,$e(a2)
  46.     swap d0
  47.     move.w d0,$a(a2)
  48.  
  49.     move.l #screen,d0        ;4th quarter
  50.     move.l #bitplane4,a2
  51.     move.w d0,$6(a2)
  52.     swap d0
  53.     move.w d0,$2(a2)
  54.     swap d0
  55.     addq.l #2,d0
  56.     move.w d0,$e(a2)
  57.     swap d0
  58.     move.w d0,$a(a2)
  59.  
  60.     move.w #seed,rand(a1)
  61.     move.w #$7fff,$9a(a0)
  62.     move.w #$8730,$96(a0)
  63.     move.l #copper,$80(a0)
  64.  
  65. *-----------------------------------------------------------------------------
  66.  
  67. wloop    andi.w #$10,$dff01e        ;wait for a copper irq
  68.     beq.s wloop
  69.     move.w #$10,$dff09c
  70.  
  71.     bsr routine
  72.  
  73.     btst #6,$bfe001
  74.     bne wloop
  75.     
  76. End    Move.l $4,a6        ;restor system
  77.     move.l #gfxtext,a1
  78.     moveq #0,d0
  79.     jsr -$228(a6)
  80.     addi.l #$26,d0
  81.     move.l d0,a0
  82.     move.l (a0),$dff080
  83.     clr.w $dff088
  84.  
  85.     move.l #vars,a1
  86.     move.w orig_inten(a1),d0
  87.     move.w orig_dmacon(a1),d1
  88.     ori.w #$c000,d0
  89.     move.w #$7fff,$dff09a
  90.     move.w d0,$dff09a
  91.     ori.w #$8000,d1
  92.     move.w #$7fff,$dff096
  93.     move.w d1,$dff096
  94.  
  95.     movem.l (a7)+,a0-a6/d1-d7
  96.     moveq #0,d0
  97.     rts
  98.  
  99. *----------------------------------------------------------------------------
  100.                            ****  ROUTINES ****
  101. *----------------------------------------------------------------------------
  102.  
  103. routine    move.w rand(a1),d0        
  104.     move.w #constant1,d1        ;any old number
  105.     move.w #constant2,d2        ;any old number
  106.     move.l #screen,a0
  107.     move #($44*23)-1,d7
  108. loop    add.w d1,d0        ;bit of maths to produce
  109.     ror.w #1,d0        ;some 'random' numbers
  110.     neg.w d0
  111.     add.w d2,d0
  112.     add.w #constant3,d2        ;any old number
  113.     move.w d0,(a0)+
  114.     dbf d7,loop
  115.     add.w d0,rand(a1)        ;start at number last created
  116.     rts
  117.  
  118. *----------------------------------------------------------------------------
  119.  
  120. vars    dcb.w $10,0
  121.  
  122. orig_inten  equ $0
  123. orig_dmacon equ $2
  124. rand      equ $4
  125.  
  126. gfxtext    dc.b "graphics.library",$0
  127.  
  128.     even
  129.  
  130.     section chipstuff,data_c
  131.  
  132. copper    dc.l $0101ff00,$01002200,$01020007,$01040000
  133.     dc.l $008e2461,$009034d1,$00920028,$009400d8
  134.     dc.l $01080000,$010a0000,$01fc0000
  135.  
  136. bitplane1    dc.l $00e00000,$00e20000,$00e40000,$00e60000
  137.     dc.l $00e80000,$00ea0000,$00ec0000,$00ee0000
  138. copcol    dc.l $01800000,$01820fff,$01840ccc,$01860000
  139.     dc.l $01880fff,$018a0fff,$018c0fff,$018e0fff
  140.     dc.l $01900fff,$01920fff,$01940fff,$01960fff
  141.     dc.l $01980fff,$019a0fff,$019c0fff,$019e0fff
  142.     dc.l $01a00000,$01a20FFF,$01a40EEF,$01a60DDF
  143.     dc.l $01a80CCF,$01aA0BBF,$01aC0AAF,$01aE099F
  144.     dc.l $01b0088F,$01b2066E,$01b4055C,$01b6033B
  145.     dc.l $01b8022A,$01bA0119,$01bC0117,$01bE0006
  146.  
  147. copspr    dc.l $01200000,$01220000,$01240000,$01260000
  148.     dc.l $01280000,$012a0000,$012c0000,$012e0000
  149.     dc.l $01300000,$01320000,$01340000,$01360000
  150.     dc.l $01380000,$013a0000,$013c0000,$013e0000
  151.     dc.l $009c8010
  152.  
  153.     dc.l $6801ff00
  154.  
  155. bitplane2    dc.l $00e00000,$00e20000,$00e40000,$00e60000
  156.     dc.l $ac01ff00
  157.  
  158. bitplane3    dc.l $00e00000,$00e20000,$00e40000,$00e60000
  159.     dc.l $f001ff00
  160.  
  161. bitplane4    dc.l $00e00000,$00e20000,$00e40000,$00e60000
  162.     dc.l $fffffffe
  163.  
  164. screen ds.w 20*256
  165.  
  166.